package com.mccken.designpattern.chain.china2;

import cn.hutool.json.JSONUtil;

public class President extends Approver {

	public President(String name) {
		super(name);
	}
	
	@Override
	public void processRequest(PurchaseRequest request) {
		if (request.getAmount() < 500000) {
			System.out.println(JSONUtil.toJsonStr(request) + ":" + this.name+"：董事长");
		} else {
			this.successor.processRequest(request); 	
		}
	}
}